package apiday08.reflect;

import apiday08.reflect.annotation.AutoRunMethod;

import java.lang.reflect.Method;

public class ReflectDemo12 {
    public static void main(String[] args) throws Exception {
        Class cls = Class.forName("apiday08.reflect.Person");

        Method method = cls.getMethod("study");
        if (method.isAnnotationPresent(AutoRunMethod.class)) {
            AutoRunMethod arm = method.getAnnotation(AutoRunMethod.class);
            int value = arm.value();
            System.out.println(value);
        }

    }
}
